package edu.unf.cen6940.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.Calendar;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllThesisstatuss", query = "select myThesisstatus from Thesisstatus myThesisstatus"),
		@NamedQuery(name = "findThesisstatusByComments", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.comments = ?1"),
		@NamedQuery(name = "findThesisstatusByCommentsContaining", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.comments like ?1"),
		@NamedQuery(name = "findThesisstatusByDefended", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.defended = ?1"),
		@NamedQuery(name = "findThesisstatusByDefendedContaining", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.defended like ?1"),
		@NamedQuery(name = "findThesisstatusByDefenseDate", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.defenseDate = ?1"),
		@NamedQuery(name = "findThesisstatusByDefensePass", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.defensePass = ?1"),
		@NamedQuery(name = "findThesisstatusByDefensePassContaining", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.defensePass like ?1"),
		@NamedQuery(name = "findThesisstatusByPrimaryKey", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.thesisStatusId = ?1"),
		@NamedQuery(name = "findThesisstatusByProposalDate", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.proposalDate = ?1"),
		@NamedQuery(name = "findThesisstatusByProposalPass", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.proposalPass = ?1"),
		@NamedQuery(name = "findThesisstatusByProposalPassContaining", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.proposalPass like ?1"),
		@NamedQuery(name = "findThesisstatusByProposed", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.proposed = ?1"),
		@NamedQuery(name = "findThesisstatusByProposedContaining", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.proposed like ?1"),
		@NamedQuery(name = "findThesisstatusByThesisStatusId", query = "select myThesisstatus from Thesisstatus myThesisstatus where myThesisstatus.thesisStatusId = ?1") })
@Table(catalog = "ThesisManagement", name = "ThesisStatus")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "rms_test/edu/unf/cen6940/domain", name = "Thesisstatus")
public class Thesisstatus implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "thesisStatusID", nullable = false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer thesisStatusId;
	/**
	 */

	@Column(name = "proposed", length = 1, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String proposed;
	/**
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "proposalDate", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar proposalDate;
	/**
	 */

	@Column(name = "defended", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String defended;
	/**
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "defenseDate")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar defenseDate;
	/**
	 */

	@Column(name = "proposalPass", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String proposalPass;
	/**
	 */

	@Column(name = "defensePass", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String defensePass;
	/**
	 */

	@Column(name = "comments", length = 1024)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String comments;

	/**
	 */
	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(catalog = "ThesisManagement", name = "ThesisToThesisStatus", joinColumns = { @JoinColumn(name = "thesisstatusID", referencedColumnName = "thesisStatusID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "thesisID", referencedColumnName = "thesisID", nullable = false, updatable = false) })
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesis> thesises;

	/**
	 */
	public void setThesisStatusId(Integer thesisStatusId) {
		this.thesisStatusId = thesisStatusId;
	}

	/**
	 */
	public Integer getThesisStatusId() {
		return this.thesisStatusId;
	}

	/**
	 */
	public void setProposed(String proposed) {
		this.proposed = proposed;
	}

	/**
	 */
	public String getProposed() {
		return this.proposed;
	}

	/**
	 */
	public void setProposalDate(Calendar proposalDate) {
		this.proposalDate = proposalDate;
	}

	/**
	 */
	public Calendar getProposalDate() {
		return this.proposalDate;
	}

	/**
	 */
	public void setDefended(String defended) {
		this.defended = defended;
	}

	/**
	 */
	public String getDefended() {
		return this.defended;
	}

	/**
	 */
	public void setDefenseDate(Calendar defenseDate) {
		this.defenseDate = defenseDate;
	}

	/**
	 */
	public Calendar getDefenseDate() {
		return this.defenseDate;
	}

	/**
	 */
	public void setProposalPass(String proposalPass) {
		this.proposalPass = proposalPass;
	}

	/**
	 */
	public String getProposalPass() {
		return this.proposalPass;
	}

	/**
	 */
	public void setDefensePass(String defensePass) {
		this.defensePass = defensePass;
	}

	/**
	 */
	public String getDefensePass() {
		return this.defensePass;
	}

	/**
	 */
	public void setComments(String comments) {
		this.comments = comments;
	}

	/**
	 */
	public String getComments() {
		return this.comments;
	}

	/**
	 */
	public void setThesises(Set<Thesis> thesises) {
		this.thesises = thesises;
	}

	/**
	 */
	public Set<Thesis> getThesises() {
		if (thesises == null) {
			thesises = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesis>();
		}
		return thesises;
	}

	/**
	 */
	public Thesisstatus() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Thesisstatus that) {
		setThesisStatusId(that.getThesisStatusId());
		setProposed(that.getProposed());
		setProposalDate(that.getProposalDate());
		setDefended(that.getDefended());
		setDefenseDate(that.getDefenseDate());
		setProposalPass(that.getProposalPass());
		setDefensePass(that.getDefensePass());
		setComments(that.getComments());
		setThesises(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesis>(that.getThesises()));
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("thesisStatusId=[").append(thesisStatusId).append("] ");
		buffer.append("proposed=[").append(proposed).append("] ");
		buffer.append("proposalDate=[").append(proposalDate).append("] ");
		buffer.append("defended=[").append(defended).append("] ");
		buffer.append("defenseDate=[").append(defenseDate).append("] ");
		buffer.append("proposalPass=[").append(proposalPass).append("] ");
		buffer.append("defensePass=[").append(defensePass).append("] ");
		buffer.append("comments=[").append(comments).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((thesisStatusId == null) ? 0 : thesisStatusId.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Thesisstatus))
			return false;
		Thesisstatus equalCheck = (Thesisstatus) obj;
		if ((thesisStatusId == null && equalCheck.thesisStatusId != null) || (thesisStatusId != null && equalCheck.thesisStatusId == null))
			return false;
		if (thesisStatusId != null && !thesisStatusId.equals(equalCheck.thesisStatusId))
			return false;
		return true;
	}
}
